package com.cluster.platform.common.api;

/**
 * 枚举了一些常用API操作码
 */
public enum ResultCode implements IErrorCode {
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    VALIDATE_FAILED(404, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    SEARCH_FAIL(40401,"查找失败"),
    PARAM_NULL(40402,"参数为空"),
    FORBIDDEN(403, "没有相关权限"),
    ADD_FAIL(1011,"新增失败"),
    ADD_SUCCESS(1010,"新增成功"),
    UPDATE_FAIL(1021,"修改失败"),
    UPDATE_SUCCESS(1020,"修改成功"),
    USER_NULL(404,"用户为空"),
    NO_RECORD(200,"无记录"),
    REPEAT(101,"重复数据");
    private long code;
    private String message;

    private ResultCode(long code, String message) {
        this.code = code;
        this.message = message;
    }

    public long getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
